# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-proxmoxer
pkgver=2.1.0
pkgrel=0
pkgdesc="Python wrapper for Proxmox API v2"
url="https://github.com/proxmoxer/proxmoxer"
arch="noarch"
license="MIT"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
checkdepends="
	py3-mock
	py3-openssh-wrapper
	py3-paramiko
	py3-pytest
	py3-requests-toolbelt
	py3-responses
	py3-testfixtures
	"
subpackages="$pkgname-pyc"
source="https://github.com/proxmoxer/proxmoxer/archive/$pkgver/proxmoxer-$pkgver.tar.gz"
builddir="$srcdir/proxmoxer-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
00e983262c01dbd2deb61e24666ab70acccaf78e658fd0f78314e5f64cb9b35b1a6de83d30c70d36b3e8a2909986becce83916024880ac34189e78051a9b7022  proxmoxer-2.1.0.tar.gz
"
